package com.atguigu.springcloud.dao;

import com.atguigu.springcloud.domain.Payment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface PaymentDao {

    @Insert("insert into payment values(#{id},#{serial})")
    public int addPayment(Payment payment);

    @Select("select * from payment where id = #{id}")
    public Payment findById(@Param("id") String id);

    @Select("select * from payment")
    public List<Payment> findAll();
}